package com.zangs.emqx_expand.emqx.utils;

import org.apache.commons.codec.digest.DigestUtils;

import java.nio.charset.StandardCharsets;
import java.util.UUID;

public class EncryptUtils {
    public static String sha256(String plainString, String salt) {
        return DigestUtils.sha256Hex((plainString + salt).getBytes(StandardCharsets.UTF_8));
    }


    public static void getSecret() {
        //生成应用id和密钥提供给第三方使用，具体生成规则自己定
        String appId = UUID.randomUUID().toString().replace("-", "").toLowerCase();
        String appSecret = UUID.randomUUID().toString().replace("-", "").toUpperCase();
        System.out.println("appId:" + appId);
        System.out.println("appSecret:" + appSecret);


    }


}
